<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>悠南山养老中心管理系统</title>
    <link rel="stylesheet" type="text/css" href="${params.contextPath}/static/plug/fontawesome/css/font-awesome.min.css?_t=${params.pageRandom!}">
    <link rel="shortcut icon" href="${params.contextPath!}/static/img/favicon.ico" type="image/x-icon">
    <link rel="icon" href="${params.contextPath!}/static/img/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/bootstrap.min.css">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/materialdesignicons.min.css">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/js/bootstrap-multitabs/multitabs.min.css">
    <link rel="stylesheet" href="${params.contextPath!}/static/ui/css/style.min.css">
    <style>
        .lyear-layout-sidebar-scroll{overflow:auto;}
        ::-webkit-scrollbar-track-piece{width:6px;background-color1:#4e4e5a;}
        ::-webkit-scrollbar{width:6px;height:6px ; }
        ::-webkit-scrollbar-thumb{height:50px;background:#aaa;cursor:pointer;}
        ::-webkit-scrollbar-thumb:hover{background:#4e4e5a; cursor:pointer;}
        .nav-drawer > li > a > i{top:16px;}
        #logo > a{color:#fff;height:68px;line-height:68px;font-size: 22px;}
    </style>
</head>

<body data-logobg="color_7" data-headerbg="color_7" data-sidebarbg="color_8">
<div class="lyear-layout-web">
    <div class="lyear-layout-container">
        <!--左侧导航-->
        <aside class="lyear-layout-sidebar">

            <!-- logo -->
            <div id="logo" class="sidebar-header">
                <a href="index.html">悠南山养老中心<!--<img src="${params.contextPath!}/static/ui/images/logo-sidebar.png"/>--></a>
            </div>
            <div class="lyear-layout-sidebar-scroll">
                <nav class="sidebar-main">
                    <ul class="nav nav-drawer">
                    </ul>
                </nav>
                <!--<div class="sidebar-footer">
                    <p class="copyright">Copyright &copy; 2019. <a target="_blank" href="http://www.yunfeisoft.com">云飞工作室</a> All rights reserved.</p>
                </div>-->
            </div>

        </aside>
        <!--End 左侧导航-->

        <!--头部信息-->
        <header class="lyear-layout-header">

            <nav class="navbar navbar-default">
                <div class="topbar">

                    <div class="topbar-left">
                        <div class="lyear-aside-toggler">
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                            <span class="lyear-toggler-bar"></span>
                        </div>
                    </div>

                    <ul class="topbar-right">
                        <li class="dropdown dropdown-profile">
                            <a href="javascript:void(0)" data-toggle="dropdown">
                                <img class="img-avatar img-avatar-48 m-r-10" src="${params.contextPath!}/static/ui/images/users/avatar.jpg"/>
                                <span><span class="user-name">笔下光年</span> <span class="caret"></span></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right">
                                <li><a class="multitabs" data-url="${params.contextPath!}/view/base/user/user_center" href="javascript:void(0)"><i class="mdi mdi-account"></i> 个人信息</a></li>
                                <li><a class="multitabs" data-url="${params.contextPath!}/view/base/user/user_center" href="javascript:void(0)"><i class="mdi mdi-lock-outline"></i> 修改密码</a></li>
                                <!--<li><a href="javascript:void(0)"><i class="mdi mdi-delete"></i> 清空缓存</a></li>-->
                                <li class="divider"></li>
                                <li><a href="javascript:void(0)" class="login-out" reurl="${params.contextPath!}/loginOut"><i class="mdi mdi-logout-variant"></i> 退出登录</a>
                                </li>
                            </ul>
                        </li>
                        <!--切换主题配色-->
                        <li class="dropdown dropdown-skin">
                            <span data-toggle="dropdown" class="icon-palette"><i class="mdi mdi-palette"></i></span>
                            <ul class="dropdown-menu dropdown-menu-right" data-stopPropagation="true">
                                <li class="drop-title">
                                    <p>LOGO</p>
                                </li>
                                <li class="drop-skin-li clearfix">
                                    <span class="inverse">
                                        <input type="radio" name="logo_bg" value="default" id="logo_bg_1" checked>
                                        <label for="logo_bg_1"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_2" id="logo_bg_2">
                                        <label for="logo_bg_2"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_3" id="logo_bg_3">
                                        <label for="logo_bg_3"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_4" id="logo_bg_4">
                                        <label for="logo_bg_4"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_5" id="logo_bg_5">
                                        <label for="logo_bg_5"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_6" id="logo_bg_6">
                                        <label for="logo_bg_6"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_7" id="logo_bg_7">
                                        <label for="logo_bg_7"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="logo_bg" value="color_8" id="logo_bg_8">
                                        <label for="logo_bg_8"></label>
                                    </span>
                                </li>
                                <li class="drop-title">
                                    <p>头部</p>
                                </li>
                                <li class="drop-skin-li clearfix">
                                    <span class="inverse">
                                        <input type="radio" name="header_bg" value="default" id="header_bg_1" checked>
                                        <label for="header_bg_1"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_2" id="header_bg_2">
                                        <label for="header_bg_2"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_3" id="header_bg_3">
                                        <label for="header_bg_3"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_4" id="header_bg_4">
                                        <label for="header_bg_4"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_5" id="header_bg_5">
                                        <label for="header_bg_5"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_6" id="header_bg_6">
                                        <label for="header_bg_6"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_7" id="header_bg_7">
                                        <label for="header_bg_7"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="header_bg" value="color_8" id="header_bg_8">
                                        <label for="header_bg_8"></label>
                                    </span>
                                </li>
                                <li class="drop-title">
                                    <p>侧边栏</p>
                                </li>
                                <li class="drop-skin-li clearfix">
                                    <span class="inverse">
                                        <input type="radio" name="sidebar_bg" value="default" id="sidebar_bg_1" checked>
                                        <label for="sidebar_bg_1"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_2" id="sidebar_bg_2">
                                        <label for="sidebar_bg_2"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_3" id="sidebar_bg_3">
                                        <label for="sidebar_bg_3"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_4" id="sidebar_bg_4">
                                        <label for="sidebar_bg_4"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_5" id="sidebar_bg_5">
                                        <label for="sidebar_bg_5"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_6" id="sidebar_bg_6">
                                        <label for="sidebar_bg_6"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_7" id="sidebar_bg_7">
                                        <label for="sidebar_bg_7"></label>
                                    </span>
                                    <span>
                                        <input type="radio" name="sidebar_bg" value="color_8" id="sidebar_bg_8">
                                        <label for="sidebar_bg_8"></label>
                                    </span>
                                </li>
                            </ul>
                        </li>
                        <!--切换主题配色-->
                    </ul>

                </div>
            </nav>

        </header>
        <!--End 头部信息-->

        <!--页面主要内容-->
        <main class="lyear-layout-content">
            <div id="iframe-content"></div>
        </main>
        <!--End 页面主要内容-->
    </div>
</div>
<script id="menu-template" type="text/html" style="display: none">
    {{ each list item index }}
    <li class="nav-item nav-item-has-subnav">
        {{if !item.children}}
        <a class="multitabs" href="{{item.url}}"><i class="fa {{item.icon}}"></i> <span>{{item.name}}</span></a>
        {{else}}
        <a href="javascript:void(0)"><i class="fa {{item.icon}}"></i> <span>{{item.name}}</span></a>
        <ul class="nav nav-subnav">
            {{ each item.children menu index }}
            <li><a class="multitabs" href="{{menu.url}}"><i class="fa {{menu.icon}}"></i> <span>{{menu.name}}</span></a></li>
            {{ /each }}
        </ul>
        {{/if}}
    </li>
    {{ /each }}
</script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/jquery.min.js"></script>
<script type="text/javascript" src="${params.contextPath!}/static/plug/layui/layui.all.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/bootstrap-multitabs/multitabs.js"></script>
<script type="text/javascript" src="${params.contextPath!}/static/ui/js/index.min.js"></script>
<script type="text/javascript" src="${params.contextPath!}/static/js/template-web.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript" src="${params.contextPath!}/static/js/tools.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript" src="${params.contextPath!}/static/js/support.js?_t=${params.pageRandom!}"></script>
<script type="text/javascript">
    top.domain = '${params.contextPath!}';

    var Application = {
        getMenus: function (menuArray) {
            var temp = {}, tree = [];
            for (var i = 0; i < menuArray.length; i++) {
                var menu = menuArray[i];
                if (menu.category != 1) {
                    continue;
                }
                menu.url = "${params.contextPath!}" + menu.url;
                temp[menu.id] = menu;
            }
            for (var i = 0; i < menuArray.length; i++) {
                var menu = menuArray[i];
                if (menu.category != 1) {
                    continue;
                }
                var parent = temp[menu.parentId];
                if (parent) {
                    if (!parent.children) {
                        parent.children = [];
                    }
                    parent.children.push(menu);
                    continue;
                }
                tree.push(menu);
            }
            var html = $.template("menu-template", {list : tree});
            $(".lyear-layout-sidebar-scroll .nav-drawer").html(html);
            initMenus();
        },
        getUser: function () {
            $(".user-name").html("${user.name!'--'}");
        },
        loadMenus: function () {
            var menuArray = eval('(${user.menuJsonArray!})');
            Application.getMenus(menuArray);
        },
        modifySimplePass: function () {
            layer.open({
                type: 2, shade: 0.3, title: "修改密码",
                closeBtn: 0,
                shadeClose: false,
                area: ['650px', '450px'],
                content: '${params.contextPath!}/view/base/user/user_pass?_t=' + new Date().getTime()
            });
        },
        cacheDictionary:function () {
            $.ajax({
                url: '${params.contextPath!}/web/dictionary/queryAcceptList',
                type: 'GET',
                async:false,
                success: function (resp) {
                    if (!resp.success) {
                        alert(data.message);
                        return;
                    }
                    DictionaryHelper.cacheDictionary(resp.data);
                },
                dataType: 'json'
            });
        },
        cacheArea:function () {
            $.ajax({
                url: '${params.contextPath!}/web/area/queryAcceptList',
                type: 'GET',
                async:true,
                success: function (resp) {
                    if (!resp.success) {
                        alert(data.message);
                        return;
                    }
                    AreaHelper.cacheArea(resp.data);
                    layer.closeAll();
                },
                dataType: 'json'
            });
        },
        init: function () {
            this.getUser();
            this.loadMenus();

            layer.msg('初始化数据中...', {icon:16,shade:0,offset:'t',time:0});
            this.cacheDictionary();
            this.cacheArea();

        <#if (user.simplePass)??>
            this.modifySimplePass();
        </#if>
        }
    };

    $(function () {
        $(".login-out").click(function () {
            layer.msg('退出中......', {icon:16,shade:0,offset:'t',time:0});
            var url = $(this).attr("reurl");
            $.post(url, function (data) {
                if (data.success) {
                    location.href = "${params.contextPath!}/login.htm";
                    return;
                }
                layer.closeAll();
                alert(data.message);
            });
        });
        Application.init();
        //定时发送保持心跳的请求,避免登录过期
        setInterval(keepAlive, 1000 * 60 * 10);

        // 选项卡
        $('#iframe-content').multitabs({
            iframe : true,
            nav: {backgroundColor:'#ffffff',maxTabs:35},
            //init : [{type : 'main',title : '工作台',url : '${params.contextPath!}/view/workbench'}]
            init : [{type : 'main',title : '待办事项',url : '${params.contextPath!}/view/base/workflowTask/workflowTask_list'}]
        });
    });

    //发送保持心跳的请求
    function keepAlive() {
        $.ajax({
            url: '${params.contextPath}/web/keepAlive',
            type: 'GET',
            success: function (resp) {
                if (!resp.success) {
                    window.location.href = '${params.contextPath}/login';
                }
            },
            dataType: 'json'
        });
    }
</script>
</body>
</html>